package org.hawk.gwtppc.webtest.tests.classsuite;

import java.lang.annotation.Annotation;
import java.util.RandomAccess;

import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.AnnotationMock;
import org.hawk.gwtppc.webtest.tests.mock.ClassMock;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock1;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock2;

public class IsAssignableFromTest implements Test {

	public void run() throws Throwable {
		Asserts.assertTrue(ClassMock.class.isAssignableFrom(SubClassMock1.class));
		Asserts.assertTrue(RandomAccess.class.isAssignableFrom(SubClassMock1.class));
		Asserts.assertTrue(ClassMock.class.isAssignableFrom(SubClassMock2.class));
		Asserts.assertTrue(Appendable.class.isAssignableFrom(ClassMock.class));
		Asserts.assertTrue(Appendable.class.isAssignableFrom(SubClassMock2.class));
		Asserts.assertFalse(AnnotationMock.class.isAssignableFrom(SubClassMock2.class));
		Asserts.assertTrue(Annotation.class.isAssignableFrom(AnnotationMock.class));
	}

	public String getName() {
		return "isAssignableFrom(Class<?> cls)";
	}

}
